package router

import (
	"github.com/gin-gonic/gin"
	"goods-master/handlers"
	"net/http"
)

func Init() *gin.Engine {

	r := gin.Default()

	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})

	r.GET("list", handlers.ListGoods)
	r.GET("detail", handlers.DetailGoods)
	r.GET("listPage", handlers.ListPageGoods)

	r.GET("listText", handlers.ListGoodsText)

	r.POST("create", handlers.Create)
	return r
}
